package cn.zyx.common.exception;


import cn.zyx.vo.ResultCodeEnum;
import lombok.Data;

@Data
public class DYTException extends RuntimeException{
    private Integer code;
    /**
     * 接受状态码和消息
     * @param code
     * @param message
     */
    public DYTException(Integer code, String message) {
        super(message);
        this.code=code;
    }

    /**
     * 接收枚举类型
     * @param resultCodeEnum
     */
    public DYTException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }
}
